package cn.edu.zut.cs.Business;

import cn.edu.zut.cs.Dao.UserMapper;
import cn.edu.zut.cs.Model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }


    @Override
    public int zhuceuser(String username,  String pwd,String registetime ,String phone) {
        return userMapper.zhuceuser(username,pwd,registetime,phone);
    }

    @Override
    public int updateuserinfo(String nickname, String username, String headimage, String personalsignature, String locals, String sex) {
        return userMapper.updateuserinfo(nickname,username,headimage,personalsignature,locals,sex);
    }


    @Override
    public int updatepwd(String username, String pwd) {
        return userMapper.updatepwd(username,pwd);
    }

    @Override
    public int logout(String username, String logouttime) {
        return userMapper.logout(username,logouttime);
    }

    @Override
    public User findbyusernameandpwd(String username) {
        return userMapper.findbyusernameandpwd(username);
    }

    @Override
    public List<User> findBymohu(String uname) {
        return userMapper.findBymohu(uname);
    }
}
